<div class="tpl-portlet-components" xmlns:th="http://www.thymeleaf.org">
    <div class="portlet-title">
        <div class="caption font-green bold"> 编写博客
        </div>
        <div class="tpl-portlet-input tpl-fz-ml">
            <div class="portlet-input input-small input-inline">
                <div class="input-icon right">
                    <i class="am-icon-search"></i>
                    <input type="text" class="form-control form-control-solid" placeholder="搜索..."></div>
            </div>
        </div>
    </div>

    <div class="tpl-block">

        <div class="am-g">
            <div class="tpl-form-body tpl-form-line">
                <form class="am-form tpl-form-line-form" id="add_blog_form" action="/blog/add" method="post">
                    <!--/*@thymesVar id="movie" type="movie.ruan.ruanblog.entity.Blog"*/-->
                    <input type="hidden" name="id" th:value="${blog == null ? '' : blog.id}">
                    <div class="am-form-group">
                        <label for="user-name" class="am-u-sm-3 am-form-label">标题
                            <span class="tpl-form-line-small-title">Title</span></label>
                        <div class="am-u-sm-9">
                            <input type="text" name="title" class="tpl-form-input" id="user-name" placeholder="请输入标题文字"
                                   th:value="${blog==null ? 'hello world!' : blog.title}">
                            <small>请填写标题文字10-20字左右。</small>
                        </div>
                    </div>

                    <div class="am-form-group">
                        <label name="adminId" class="am-u-sm-3 am-form-label">作者 <span
                                class="tpl-form-line-small-title">Author</span></label>
                        <div class="am-u-sm-9">
                            <select data-am-selected="{searchBox: 1}" name="admin.id">
                                <option th:each="admin :${adminList}" th:value="${admin.id}"
                                        th:text="${admin.nickname}">
                                    Author
                                </option>
                            </select>
                        </div>
                    </div>

                    <div class="am-form-group">
                        <label class="am-u-sm-3 am-form-label">博客插图 <span
                                class="tpl-form-line-small-title">Images</span></label>
                        <div class="am-u-sm-9">
                            <div class="am-form-group am-form-file">
                                <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                    <i class="am-icon-cloud-upload"></i> 添加插图
                                </button>
                                <input type="hidden" name="image"  th:value="${blog==null?'':blog.image}">
                                <input id="doc-form-file" type="file">
                            </div>

                        </div>
                    </div>

                    <div class="am-form-group">
                        <label class="am-u-sm-3 am-form-label">文章内容</label>
                        <div class="am-u-sm-9">
                            <!--<textarea class="" rows="10" id="user-intro" placeholder="请输入文章内容"></textarea>-->
                            <textarea class="ckeditor" id="editor1"
                                      th:text="${blog==null?'Test content ...' : blog.content}"></textarea>
                        </div>
                    </div>

                    <div class="am-form-group">
                        <div class="am-u-sm-9 am-u-sm-push-3">
                            <button type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success "
                                    onclick="saveBlog()">保存博客
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    ckEditor = CKEDITOR.replace('editor1');
    $(function () {
        // 使用默认参数
        $('select').selected();

        // 设置参数
        $('select').selected({
            btnWidth: '300px',
            btnSize: 'sm',
            btnStyle: 'primary',
            maxHeight: '100px'
        });
    });
</script>
<!--<script src=" assets/js/jquery.min.js"></script>
<script src="assets/js/amazeui.min.js"></script>-->
